package com.bioroadlab.pojo;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * TestItem entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "test_item", catalog = "bioroadlab")
public class TestItem implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1L;

	private Integer sn;
	private String test;
	private String code;
	private BigDecimal price;
	private String description;
	private Integer primer;
	private BigDecimal cost;
	private BigDecimal minPrice;
	private BigDecimal avg1;
	private BigDecimal avg2;
	private String notes;
	private BigDecimal sumPrice;
	private String developer;
	private String verifier;
	private String infoFound;
	private String primerDesigned;
	private Integer parent;
	private String editor;
	private Timestamp editTime;
	private Integer status;
	private String combine1;
	private String combine2;
	private String combine3;
	private String name;
	private String sampleType;
	private BigDecimal sampleVolume;
	private String testType;
	private String testCategory;

	private Set<TestObject> testObjects = new HashSet<TestObject>(0);
	private Set<Disease> diseases = new HashSet<Disease>(0);
	private Set<SampleInfo> sampleInfos = new HashSet<SampleInfo>(0);

	// Property accessors
	@TableGenerator(table = "id_generator", name = "generator", pkColumnName = "name", pkColumnValue = "TestItem", valueColumnName = "id", initialValue = 1, allocationSize = 1)
	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.TABLE)
	@Column(name = "sn", unique = true, nullable = false)
	public Integer getSn() {
		return this.sn;
	}

	public void setSn(Integer sn) {
		this.sn = sn;
	}

	@Column(name = "test", length = 50)
	public String getTest() {
		return this.test;
	}

	public void setTest(String test) {
		this.test = test;
	}

	@Column(name = "code", length = 20)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "price", precision = 10)
	public BigDecimal getPrice() {
		return this.price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "primer")
	public Integer getPrimer() {
		return this.primer;
	}

	public void setPrimer(Integer primer) {
		this.primer = primer;
	}

	@Column(name = "cost", precision = 10)
	public BigDecimal getCost() {
		return this.cost;
	}

	public void setCost(BigDecimal cost) {
		this.cost = cost;
	}

	@Column(name = "min_price", precision = 10)
	public BigDecimal getMinPrice() {
		return this.minPrice;
	}

	public void setMinPrice(BigDecimal minPrice) {
		this.minPrice = minPrice;
	}

	@Column(name = "avg1", precision = 10)
	public BigDecimal getAvg1() {
		return this.avg1;
	}

	public void setAvg1(BigDecimal avg1) {
		this.avg1 = avg1;
	}

	@Column(name = "avg2", precision = 10, scale = 1)
	public BigDecimal getAvg2() {
		return this.avg2;
	}

	public void setAvg2(BigDecimal avg2) {
		this.avg2 = avg2;
	}

	@Column(name = "notes", length = 500)
	public String getNotes() {
		return this.notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	@Column(name = "sum_price", precision = 10)
	public BigDecimal getSumPrice() {
		return this.sumPrice;
	}

	public void setSumPrice(BigDecimal sumPrice) {
		this.sumPrice = sumPrice;
	}

	@Column(name = "developer", length = 20)
	public String getDeveloper() {
		return this.developer;
	}

	public void setDeveloper(String developer) {
		this.developer = developer;
	}

	@Column(name = "verifier", length = 20)
	public String getVerifier() {
		return this.verifier;
	}

	public void setVerifier(String verifier) {
		this.verifier = verifier;
	}

	@Column(name = "info_found", length = 20)
	public String getInfoFound() {
		return this.infoFound;
	}

	public void setInfoFound(String infoFound) {
		this.infoFound = infoFound;
	}

	@Column(name = "primer_designed", length = 20)
	public String getPrimerDesigned() {
		return this.primerDesigned;
	}

	public void setPrimerDesigned(String primerDesigned) {
		this.primerDesigned = primerDesigned;
	}

	@Column(name = "parent")
	public Integer getParent() {
		return this.parent;
	}

	public void setParent(Integer parent) {
		this.parent = parent;
	}

	@Column(name = "editor", length = 50)
	public String getEditor() {
		return this.editor;
	}

	public void setEditor(String editor) {
		this.editor = editor;
	}

	@Column(name = "edit_time", length = 19)
	public Timestamp getEditTime() {
		return this.editTime;
	}

	public void setEditTime(Timestamp editTime) {
		this.editTime = editTime;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "combine1", length = 100)
	public String getCombine1() {
		return this.combine1;
	}

	public void setCombine1(String combine1) {
		this.combine1 = combine1;
	}

	@Column(name = "combine2", length = 100)
	public String getCombine2() {
		return this.combine2;
	}

	public void setCombine2(String combine2) {
		this.combine2 = combine2;
	}

	@Column(name = "combine3", length = 100)
	public String getCombine3() {
		return this.combine3;
	}

	public void setCombine3(String combine3) {
		this.combine3 = combine3;
	}

	@Column(name = "name", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sample_type", length = 100)
	public String getSampleType() {
		return this.sampleType;
	}

	public void setSampleType(String sampleType) {
		this.sampleType = sampleType;
	}

	@Column(name = "sample_volume", precision = 10, scale = 0)
	public BigDecimal getSampleVolume() {
		return this.sampleVolume;
	}

	public void setSampleVolume(BigDecimal sampleVolume) {
		this.sampleVolume = sampleVolume;
	}

	@Column(name = "test_type", length = 50)
	public String getTestType() {
		return this.testType;
	}

	public void setTestType(String testType) {
		this.testType = testType;
	}

	@Column(name = "test_category", length = 50)
	public String getTestCategory() {
		return testCategory;
	}

	public void setTestCategory(String testCategory) {
		this.testCategory = testCategory;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "testItems")
	public Set<TestObject> getTestObjects() {
		return this.testObjects;
	}

	public void setTestObjects(Set<TestObject> testObjects) {
		this.testObjects = testObjects;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinTable(name = "disease_test_item_rel", catalog = "bioroadlab", joinColumns = { @JoinColumn(name = "test_item", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "disease", nullable = false, updatable = false) })
	public Set<Disease> getDiseases() {
		return this.diseases;
	}

	public void setDiseases(Set<Disease> diseases) {
		this.diseases = diseases;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinTable(name = "sample_info_test_item", catalog = "bioroadlab", joinColumns = { @JoinColumn(name = "test_item", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "sample", nullable = false, updatable = false) })
	public Set<SampleInfo> getSampleInfos() {
		return this.sampleInfos;
	}

	public void setSampleInfos(Set<SampleInfo> sampleInfos) {
		this.sampleInfos = sampleInfos;
	}

}